package com.ruoyi.process.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.process.domain.KitchenWaste;
import com.ruoyi.process.mapper.KitchenWasteMapper;
import com.ruoyi.process.service.IKitchenWasteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 餐厨废弃物管理记录Service业务层处理
 *
 * @author wng
 * @date 2024-08-04
 */
@Service
public class KitchenWasteServiceImpl implements IKitchenWasteService {
    @Resource
    private KitchenWasteMapper kitchenWasteMapper;

    /**
     * 查询餐厨废弃物管理记录
     *
     * @param id 餐厨废弃物管理记录主键
     * @return 餐厨废弃物管理记录
     */
    @Override
    public KitchenWaste selectKitchenWasteById(Long id) {
        return kitchenWasteMapper.selectKitchenWasteById(id);
    }

    /**
     * 查询餐厨废弃物管理记录列表
     *
     * @param kitchenWaste 餐厨废弃物管理记录
     * @return 餐厨废弃物管理记录
     */
    @Override
    public List<KitchenWaste> selectKitchenWasteList(KitchenWaste kitchenWaste) {
        return kitchenWasteMapper.selectKitchenWasteList(kitchenWaste);
    }

    /**
     * 新增餐厨废弃物管理记录
     *
     * @param kitchenWaste 餐厨废弃物管理记录
     * @return 结果
     */
    @Override
    public int insertKitchenWaste(KitchenWaste kitchenWaste) {
        kitchenWaste.setCreateTime(DateUtils.getNowDate());
        return kitchenWasteMapper.insertKitchenWaste(kitchenWaste);
    }

    /**
     * 修改餐厨废弃物管理记录
     *
     * @param kitchenWaste 餐厨废弃物管理记录
     * @return 结果
     */
    @Override
    public int updateKitchenWaste(KitchenWaste kitchenWaste) {
        kitchenWaste.setUpdateTime(DateUtils.getNowDate());
        return kitchenWasteMapper.updateKitchenWaste(kitchenWaste);
    }

    /**
     * 批量删除餐厨废弃物管理记录
     *
     * @param ids 需要删除的餐厨废弃物管理记录主键
     * @return 结果
     */
    @Override
    public int deleteKitchenWasteByIds(Long[] ids) {
        return kitchenWasteMapper.deleteKitchenWasteByIds(ids);
    }

    /**
     * 删除餐厨废弃物管理记录信息
     *
     * @param id 餐厨废弃物管理记录主键
     * @return 结果
     */
    @Override
    public int deleteKitchenWasteById(Long id) {
        return kitchenWasteMapper.deleteKitchenWasteById(id);
    }
}
